__author__ = 'chenwei'
# -*- coding: utf-8 -*-
'''
版本二：通过增加一个列表result，把最大值和最小值传出来。解决传值问题。
'''
result=[False,False]
def find_list_max_min(this_list):
    for item in this_list:
        if isinstance(item,list):
            find_list_max_min(item)
        else:
            if isinstance(item, (int, float)):
                if item > result[1] or result[1] == False:
                    result[1] = item
                if item < result[0] or result[0] == False:
                    result[0] = item


if __name__ == '__main__':
    lists=[5,1,2,3,4,"abc0",5.5,"6a",-1,[7,7.5]]
    #lists=[1,2,3,4,5]
    find_list_max_min(lists)
    print("-"*8+"result"+"-"*8)
    print("this_list=",lists)
    print("max_value=",result[1])
    print("min_value=",result[0])
    print("-" * 22 )